﻿using System.Linq.Expressions;
using LocalTest.Domain.Shared;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Microsoft.EntityFrameworkCore.ValueGeneration;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace LocalTest.Infrastructure.Configurations;

public static class ConfigurationExtensions
{
    public static void ConfigureRootEntity<T>(this EntityTypeBuilder<T> builder) where T : RootEntity
    {
        builder.Property(p => p.Id).HasValueGenerator<StringValueGenerator>().HasMaxLength(36);
    }
}